﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AllCategoryNav.ascx.cs"
    Inherits="Goods_AllCategoryNav" %>
<%@ Import Namespace="Shopping.Common" %>
<%@ Import Namespace="Shopping.Model" %>
<%@ Import Namespace="Shopping.BLL" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%
        if (listOfCategory != null)
        {
            for (int i = 0; i < listOfCategory.Count; ++i)
            {
                CategoryMenu c = listOfCategory[i];
                IDNameObj fc = c.FCategory;
                List<IDNameObj> listOfSC = c.SCategorys;

                Response.Write("<div class='categoryRow'><h1 class=\"titleOne categoryTitle " + (i > 0 ? "titleTwo" : "") + "\" style=''>");
                Response.Write("<a href=\"" + bllUrl.GetGoodsListUrl(fc.ID) + "\">");
                Response.Write(fc.Name);
                Response.Write("</a>");
                Response.Write("</h1>");
                if (listOfSC != null)
                {
                    Response.Write("<ul class=\"importedFoods categoryCblock\">");
                    for (int j = 0; j < listOfSC.Count; ++j)
                    {
                        IDNameObj sc = listOfSC[j];
                        List<IDNameObj> listOfTC = null;
                        if (c.TCategorys.ContainsKey(sc.ID))
                            listOfTC = c.TCategorys[sc.ID];

                        Response.Write("<li  class=\"topLineLi " + (j == 0 ? "topnoLineLi" : "") + "\">");
                        Response.Write(" <span class=\"dairyTitle dairyW\">");
                        Response.Write("<a class=\"greenTitle\" href=\"" + bllUrl.GetGoodsListUrl(fc.ID, sc.ID) + "\">");
                        Response.Write(sc.Name);
                        Response.Write("</a>");
                        Response.Write("</span>");
                        if (listOfTC != null)
                        {
                            for (int m = 0; m < listOfTC.Count; ++m)
                            {
                                if (m == 0 || (m + 1) % 2 > 0)
                                {
                                    //Response.Write("<p class=\"dairyP dairyPw\">");
                                    Response.Write("<a  href=\"" + bllUrl.GetGoodsListUrl(fc.ID, sc.ID, listOfTC[m].ID) + "\" >");
                                }
                                else
                                    Response.Write("<a  href=\"" + bllUrl.GetGoodsListUrl(fc.ID, sc.ID, listOfTC[m].ID) + "\" >");
                                Response.Write(listOfTC[m].Name);
                                Response.Write("</a>");
                                if ((m + 1) == listOfTC.Count || (m + 1) % 2 == 0)
                                { }
                                    //Response.Write("</p>");
                            }
                        }
                        Response.Write("</li>");
                    }
                    Response.Write("</ul></div>");
                }

            }
        }
%>